<template>
    <el-container style="height: 100%;width: 100%;">
      <!-- Header -->
      <el-header style="height: 80px;">
        <div class="icon-text-container">
            <div class="icon-text-container-button" @click="navGoToMenu('/test')">
                <img src="../../assets/icon_files.png" class="icon-image">
                <span class="icon-text">通信</span>
            </div>
        </div>

        <div class="icon-text-container">
            <div class="icon-text-container-button" @click="navGoToMenu('/files')">
                <img src="../../assets/icon_files.png" class="icon-image">
                <span class="icon-text">数据</span>
            </div>
        </div>

         <div class="icon-text-container">
            <div class="icon-text-container-button"  @click="navGoToMenu('/terminal')">
                <img src="../../assets/icon_terminal.png" class="icon-image">
                <span class="icon-text">终端</span>
            </div>
         </div>

        <div class="icon-text-container">
            <div class="icon-text-container-button"  @click="navGoToMenu('/transfer')">
                <img src="../../assets/icon_transfer.png" class="icon-image">
                <span class="icon-text">传输</span>
            </div>
        </div>

        <div class="icon-text-container">
            <div class="icon-text-container-button"  @click="logoutSystem('/transfer')">
                <img src="../../assets/icon_logout.png" class="icon-image">
                <span class="icon-text">退出</span>
            </div>
        </div>
      </el-header>  

      <!-- Main -->
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </template>

<script setup>

import welcome from '@/views/admin/welcome/index.vue'

import { reactive } from 'vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'

//定义路由
const router = useRouter()

const navGoToMenu = (menu) => {
  router.push(menu) // 跳转到路由
};

const logoutSystem = () =>{
  router.push("/admin")
}

</script>
  
<style lang="scss" scoped >

.el-main{
    padding:0;  /*去除内边距*/
    border:0;   /*去除边框*/
    margin:0;   /*去除外边距*/
    overflow:hidden;
    width:100%;
    height:100%;
    margin: 0px 0px;
} 

.el-header {
    background-color: #c9dff1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #333;
}

.el-main {
    background-color: #e6f2ff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #333;
}
body > .el-container {
    padding:0;  /*去除内边距*/
    border:0;   /*去除边框*/
    margin:0;   /*去除外边距*/
    overflow:hidden;
    width:100%;
    height:inherit;
  }

//菜单样式
.icon-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100; /* 可根据需要调整 */
    margin: 15px;
    padding-bottom: 1px;
}

.icon-text-container-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120%;
    padding: 3px;
    margin-right: 10px;
    cursor: pointer; /* 鼠标移动到容器上时变成手势 */
    transition: box-shadow 0.1s ease; /* 过渡效果 */
}
.icon-text-container-button:active {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 点击时的阴影效果 */
}
.icon-text-container-button:hover {
    outline: 1px solid #7eb9f8; /* 鼠标经过时的边框,不占位置的边框 */
}

.icon-image {
    width: 40px; /* 可根据需要调整 */
    height: 40px; /* 可根据需要调整 */
    margin-bottom: 0px; /* 图标和文字之间的间距 */
}

.icon-text {
    font-size: 14px; /* 可根据需要调整 */
    color: rgb(8, 8, 8);
}
//菜单样式结束

</style>
